#!/bin/bash
set -e
set -x
MYDIR="${0%/*}"
cd "$MYDIR/.."
source "recipes/common.sh"


# RECIPE START xz-native

save_CFLAGS="$CFLAGS"
save_CPPFLAGS="$CPPFLAGS"
save_LDFLAGS="$LDFLAGS"
export CFLAGS='-O2 -g'
unset CPPFLAGS
unset LDFLAGS

reset_mtime xz xz/configure.ac
mkdir -p build/xz-native
cd build/xz-native
../../xz/configure \
	--host="$BUILD" \
	--build="$BUILD" \
	--prefix="${build_prefix}" \
	--disable-shared \
	${AUTOCRAP_KLUDGE}

cd ../..
make_native_build build/xz-native

export CFLAGS="$save_CFLAGS"
export CPPFLAGS="$save_CPPFLAGS"
export LDFLAGS="$save_LDFLAGS"

# RECIPE END xz-native
